﻿
namespace Sai.Test.TestDataBuilders
{
    public static class BoilerPlateCodeBuilder
    {
        const string DefaultNamespace = "Example";

        public static string BuildFor(IBuildable singleBuildable)
        {
            return BuildFor(DefaultNamespace, singleBuildable);
        }

        public static string BuildFor(IBuildable[] multiBuildable)
        {
            return BuildFor(DefaultNamespace, multiBuildable);
        }

        public static string BuildFor(string namespaceName, IBuildable singleBuildable)
        {
            return CompilableCodeBuilder.CompilableCode()
                                .UsingDefaultNamespaces()
                                .HasNamespace(namespaceName)
                                .Includes(singleBuildable)
                                .Build();
        }

        public static string BuildFor(string namespaceName, IBuildable[] multiBuildable)
        {
            var builder = CompilableCodeBuilder.CompilableCode()
                                .UsingDefaultNamespaces()
                                .HasNamespace(namespaceName);

            foreach (IBuildable buildable in multiBuildable)
            {
                builder.Includes(buildable);
            }

            return builder.Build();
        }

    }
}
